package tp.pr5.mv.instructions.jump;


import tp.pr5.mv.Instruction;
import tp.pr5.mv.Opcode;
import tp.pr5.mv.ProgramCounter;

public class BT extends ConditionalJumps {
	
	
    public BT() {
		
		op = Opcode.BT;
	}
	
	public BT( int n ) {       // Constructor con parámetro (n).
		
		op = Opcode.BT;
		this.n = n;
		
	}
	
    public void analyzeAndJump ( int a, ProgramCounter pc ) {
		
		if ( a != 0 )           // Si a NO es cero, se hace el salto directo.
			pc.setPC( n - 1 );
		
	}
	
	public Instruction create ( int par ) {
		return new BT( par );
	}


}
